<?php


?><div id="Portlet_<?php echo $system_PortletInstanceId; ?>"><?php
$skin="portlet_".$system_PortletName."_Skin";
//echo $system_PortletId;
if (isset($$skin)) {
	
	
	$sSql="Select header From portal_skins Where portalId = ".$portalId." And name = '".$$skin."'";
	
	//echo $sSql."<br/>";
	
	$title="portlet_".$system_PortletName."_Title_".$LANG;	
	//echo $$title;
	$rs=$GLOBALS["conn"]->Execute($sSql);
	
	$template=$rs->fields["header"];
	
	$template=str_replace("\'","\\\'",$template);
	$template=str_replace("\"","\\\"",$template);
	$template=str_replace("\n","",$template);
	$template=str_replace("\t","",$template);
	$template=str_replace("\r","",$template);
	
	
	//<display tag="portlet_title"/>

    $pattern='<display name=\\\"([a-z,A-Z]*)\\\"/>';
    $replacement='".$$$1."';
    $template=preg_replace($pattern, $replacement, $template);

    $template = "echo \"".$template."\";";
	$template=str_replace("<\".","\".",$template);
	$template=str_replace(".\">",".\"",$template);
	
eval($template);
}

$portletID=$system_PortletInstanceId;
$sSql="Select variable,value_".$LANG." as value  From portal_portlet_properties where portletId=".$system_PortletId;

//echo $sSql."<br/>";
$rs=$GLOBALS["conn"]->Execute($sSql);

while (!$rs->EOF)  {
	$var="PortletText_".$rs->fields["variable"];
	$$var=$rs->fields["value"];
	$rs->MoveNext();
}

?>